﻿<%@ Page Title="" Language="C#" Theme="Default_Themes" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="LyLichLamViec.aspx.cs" Inherits="DanhMuc_LyLichLamViec" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
     <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="row-fluid">
        <div class="span12">
            <div class="box">
                <div class="box-title">
                    <h3><i class="icon-file"></i>Lý lịch làm việc</h3>
                    <div class="box-tool">
                        <a data-action="collapse" href="#"><i class="icon-chevron-up"></i></a>
                        <a data-action="close" href="#"><i class="icon-remove"></i></a>
                    </div>
                </div>
                <div class="box-content" style="color:#3a87ad;border:solid 1px;">
                    <asp:UpdatePanel ID="udt1" runat="server">
                        <ContentTemplate>
                            <div class="row-fluid">
                                <div class="span6">
                                    <div class="box-content"  style="text-align:right;">
                                        <input type="hidden" runat="server" id="codeid" />
                                        Tên công việc &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:TextBox ID="txtTencongviec" runat="server" CssClass="spannew"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator0" SetFocusOnError="true" runat="server" ValidationGroup="a" ErrorMessage="Nhập tên công việc" ForeColor="Red" ControlToValidate="txtTenCongViec"  Display="None"></asp:RequiredFieldValidator>
                                        <div style="height:5px;"></div>
                                        Đơn vị công tác &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:TextBox ID="txtDonvicongtac" runat="server" CssClass="spannew"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="true" ValidationGroup="a" ErrorMessage="Nhập tên đơn vị" ForeColor="Red" ControlToValidate="txtDonvicongtac" Display="None"></asp:RequiredFieldValidator>
                                        <div style="height:5px;"></div>
                                        Bắt đầu từ&nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:TextBox runat="server" ID="txtTu" CssClass="spancalenda"/>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ValidationGroup="a" ErrorMessage="Nhập từ ngày" ForeColor="Red" ControlToValidate="txtTu" Display="None"></asp:RequiredFieldValidator>
                                        <asp:ImageButton runat="Server" ID="Image1" ImageUrl="~/css/icons/lich.gif" AlternateText="Click to show calendar" />
                                        <ajaxToolkit:CalendarExtender ID="calendarButtonExtender" runat="server" TargetControlID="txtTu" PopupButtonID="Image1" Format="dd/MM/yyyy" />
                                        Đến&nbsp;&nbsp;&nbsp;
                                        <asp:TextBox runat="server" ID="txtDen" CssClass="spancalenda"/>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ValidationGroup="a" ErrorMessage="Nhập đến ngày" ForeColor="Red" ControlToValidate="txtDen"  Display="None"></asp:RequiredFieldValidator>
                                        <asp:CompareValidator ID="compareDatesValidator" ControlToCompare ="txtDen" ControlToValidate="txtTu" Display="None" ValidationGroup="a" runat="server" ErrorMessage="Từ ngày phải  nhỏ hơn đến ngày" Operator="LessThan" Type="Date"></asp:CompareValidator>
                                        <asp:ImageButton runat="Server" ID="Image2" ImageUrl="~/css/icons/lich.gif" AlternateText="Click to show calendar" />
                                        <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDen" PopupButtonID="Image2" Format="dd/MM/yyyy" />
                                        <div style="height:5px;"></div>
                                        Chức vụ &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:TextBox ID="txtChucvu" runat="server" CssClass="spannew"></asp:TextBox>
                                        <div style="height:5px;"></div>
                                        Thứ tự &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:TextBox ID="txtThutu" runat="server" CssClass="spannew"></asp:TextBox>
                                        <div style="height:5px;"></div>
                                        Mô tả công việc &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:TextBox ID="txtMotacongviec" runat="server" CssClass="spannew" Height="50px" TextMode="MultiLine"></asp:TextBox>
                                        <div style="height:5px;"></div>
                                        Lý do thôi việc &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:TextBox ID="txtLydothoiviec" runat="server" CssClass="spannew"></asp:TextBox>
                                        <div style="text-align:left;">
                                            <asp:ValidationSummary ID="validationSummary" ValidationGroup="a" runat="server" HeaderText="Nhập đầy đủ các thông tin yêu cầu trước khi lưu:" ForeColor="Red" />
                                        </div>
                                    </div>
                                </div>
                                <div class="span6">
                                    <div class="box-content">
                                        <asp:GridView ID="grid" runat="server" AutoGenerateColumns="false" DataKeyNames="ID" OnRowDeleting="grid_RowDeleting">
                                            <Columns>
                                                <asp:TemplateField HeaderText="Chọn">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                                            CommandName="Delete" Text="Chọn"></asp:LinkButton>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Tên công việc" SortExpression="TenCongViec">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("TenCongViec") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="ItemGridCell" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Đơn vị công tác" SortExpression="DonViCongTac">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("DonViCongTac") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="ItemGridCell" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Chức vụ" SortExpression="ChucVu">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("ChucVu") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="ItemGridCell" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Thời gian làm việc" SortExpression="ThoiGian">
                                                    <ItemTemplate>
                                                        <%#Eval("ThoiGian") +" - "+Eval("DenNgay") %>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="ItemGridCell" />
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                        <div style="height:15px;"></div>
                                        <asp:Button ID="btnadd" runat="server" Text="Thêm mới" Width="90px" CssClass="btn btn-primary" OnClick="btnadd_Click" />
                                        <asp:Button ID="btnsave" ValidationGroup="a" runat="server" Text="Lưu" Width="90px" CssClass="btn btn-primary" OnClick="btnsave_Click"/>
                                        <asp:Button ID="btnedit" runat="server" Text="Hiệu chỉnh" Width="90px" CssClass="btn btn-primary" OnClick="btnedit_Click"/>
                                        <asp:Button ID="btndelete" runat="server" Text="Xóa" Width="90px" CssClass="btn btn-primary" OnClick="btndelete_Click" OnClientClick="return confirm('Bạn có chắc xóa không?')"/>
                                        <asp:LinkButton ID="btnclose" Visible="true" runat="server" class="btn  btn-danger"><i class="icon-signout"></i> Đóng</asp:LinkButton>
                                        <span class="help-inline"><asp:Label ID="lblmessage" runat="server" Text="" ForeColor="Red"></asp:Label></span>
                                    </div>
                                </div>
                            </div>
                        </ContentTemplate>
                        <Triggers>
                             <asp:AsyncPostBackTrigger ControlID="btnadd" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="btnsave" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="btnedit" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="btndelete" EventName="Click" />
                            <asp:AsyncPostBackTrigger ControlID="grid" EventName="RowDeleting" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </div>
        </div>
    </div>
</asp:Content>

